<?php
/**
 * 定义常量的类
 * User: hsh
 * Date: 2019/10/19
 * Time: 11:32
 */

namespace app\common\lib;


class Constant
{
    const IS_TRUE = 1;
    const IS_FLASE = 0;


    const SETTING_CATTYPE_BASE = 1; //基础参数
    const SETTING_CATTYPE_NODE = 2; //节点参数
    const SETTING_CATTYPE_SYSTEM = 3;   //系统参数

    //订单状态
    /** @var int 待支付 */
    const ORDER_STATUS_APY_WAIT = 1;
    /** @var int 取消订单 */
    const ORDER_STATUS_CANCEL = 2;
    /** @var int 支付失败 */
    const ORDER_STATUS_PAY_FAIL = 3;
    /** @var int 待验证 */
    const ORDER_STATUS_VALIDATE_WAIT = 4;
    /** @var int 验证失败 */
    const ORDER_STATUS_VALIDATE_FAIL = 5;
    /** @var int 支付成功 */
    const ORDER_STATUS_PAY_SUCCESS = 6;
    /** @var int 订单退款 */
    const ORDER_STATUS_REFUND = 7;
    /** @var int 恢复订阅 */
    const ORDER_STATUS_RECOVER = 8;

    //支付状态 1已支付 0未支付
    const ORDER_PAY_STATUS_SUCCESS = 1;

    const ORDER_PAY_STATUS_WAIT = 0;

    //星图佣金比例
    const OCEANENGINE_TALENT_COMMISSION_RATE = 70; //星图达人佣金比例
    const OCEANENGINE_DIRECT_COMMISSION_RATE = 2;   //星图直推佣金比例

    //HINOVEL佣金比例
    const HINOVEL_TALENT_COMMISSION_RATE = 30; //星图达人佣金比例
    const HINOVEL_DIRECT_COMMISSION_RATE = 2;   //星图直推佣金比例

    const SUBSCRIBE_CYCLE_TYPE_DAYS = [
            '1'=>1,
            '2'=>30,
            '3'=>90,
            '4'=>365,
            '5'=>7,
    ];

    const VIDEO_RATE_MAP = [
            '1:1'=>[512,512],
            '9:16'=>[512,910],
            '16:9'=>[910,512],
            '4:3'=>[768,512],
            '3:4'=>[512,768],
    ];

    const VIDEO_RATE_WH_MAP = [
            '3:2'=>[1080,720],
            '3:4'=>[1080,1440],
            '4:3'=>[1440,1080],
            '9:16'=>[1080,1920],
            '16:9'=>[1080,608],
    ];

    const OVERSEA_VIDEO_RATE_WH_MAP = [
            '3:4'=>[1080,1440],
            '4:3'=>[1440,1080],
            '9:16'=>[1080,1920],
    ];

    const OVERSEA_VIDEO_RATE_MAP = [
            '3:4'=>0.75,
            '4:3'=>1.3,
            '9:16'=>0.56,
    ];

    const AI_IMAGE_SERVER_DOMAIN = [
        'user'=>[
            ['domain'=>'http://118.31.172.122:9999/','ip'=>'118.31.172.122'],
            ['domain'=>'http://8.149.132.225:9999/','ip'=>'8.149.132.225'],
            ['domain'=>'http://8.138.137.187:9999/','ip'=>'8.138.137.187'],
        ],
        'admin'=>[
            ['domain'=>'http://8.134.76.154:9999/','ip'=>'8.134.76.154'],
            ['domain'=>'http://8.134.99.197:9999/','ip'=>'8.134.99.197'],
        ],
    ];

    const AI_IMAGE_SERVER_DOMAIN_LIST = [
        ['domain'=>'http://118.31.172.122:9999/','ip'=>'118.31.172.122'],
        ['domain'=>'http://8.149.132.225:9999/','ip'=>'8.149.132.225'],
        ['domain'=>'http://8.138.137.187:9999/','ip'=>'8.138.137.187'],
        ['domain'=>'http://8.134.76.154:9999/','ip'=>'8.134.76.154'],
        ['domain'=>'http://8.134.99.197:9999/','ip'=>'8.134.99.197'],
    ];

    const COMMISSION_RATE = [
                [
                    'promotion_project'=>'星图佣金',
                    'talent_commission_rate'=>self::OCEANENGINE_TALENT_COMMISSION_RATE,
                    'direct_commission_rate'=>self::OCEANENGINE_DIRECT_COMMISSION_RATE,
                ],
                [
                    'promotion_project'=>'Hinovel佣金',
                    'talent_commission_rate'=>self::HINOVEL_TALENT_COMMISSION_RATE,
                    'direct_commission_rate'=>self::HINOVEL_DIRECT_COMMISSION_RATE,
                ],
    ];

    const LANGUAGEMAP = [
        'cn'=>'中文',
        'cn'=>'普通话',
        'en'=>'英文',
        'th'=>'泰语',
        'id'=>'印尼语',
    ];


}